package com.xuecheng.search.application.service.impl;

import com.xuecheng.search.application.service.IndexApplication;
import com.xuecheng.search.domain.service.IndexService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xuecheng.base.exception.XueChengPlusException;

import java.util.Objects;

/**
 * @Author: LiJunXi
 * @Description:
 * @Date: 2024-08-31  21:56
 */
@Slf4j
@Service
public class IndexApplicationImpl implements IndexApplication {

    @Autowired
    private IndexService indexService;

    @Override
    public Boolean addIndex(String indexName, String id, Object object) {
        if (Objects.isNull(indexName) || Objects.isNull(id)){
            throw new XueChengPlusException("参数不能为空");
        }

        return indexService.addIndex(indexName, id, object);
    }
}
